package com.entity;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * AccpClass entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "ACCP_CLASS", schema = "ACCP", uniqueConstraints = @UniqueConstraint(columnNames = "CLASSNAME"))
public class AccpClass implements java.io.Serializable {

	// Fields

	private Integer cid;
	private AccpTeacher accpTeacher;
	private AccpBiz accpBiz;
	private AccpGrade accpGrade;
	private AccpClasstype accpClasstype;
	private String classname;
	private Integer cnum;
	private Integer status;
	private Timestamp createdate;
	private String classFile;
	private Set<AccpTask> accpTasks = new HashSet<AccpTask>(0);
	private Set<AccpHomework> accpHomeworks = new HashSet<AccpHomework>(0);
	private Set<AccpStudent> accpStudents = new HashSet<AccpStudent>(0);

	// Constructors

	/** default constructor */
	public AccpClass() {
	}

	/** minimal constructor */
	public AccpClass(Integer cid) {
		this.cid = cid;
	}

	/** full constructor */
	public AccpClass(Integer cid, AccpTeacher accpTeacher, AccpBiz accpBiz,
			AccpGrade accpGrade, AccpClasstype accpClasstype, String classname,
			Integer cnum, Integer status, Timestamp createdate,
			String classFile, Set<AccpTask> accpTasks,
			Set<AccpHomework> accpHomeworks, Set<AccpStudent> accpStudents) {
		this.cid = cid;
		this.accpTeacher = accpTeacher;
		this.accpBiz = accpBiz;
		this.accpGrade = accpGrade;
		this.accpClasstype = accpClasstype;
		this.classname = classname;
		this.cnum = cnum;
		this.status = status;
		this.createdate = createdate;
		this.classFile = classFile;
		this.accpTasks = accpTasks;
		this.accpHomeworks = accpHomeworks;
		this.accpStudents = accpStudents;
	}

	// Property accessors
	@Id
	@Column(name = "CID", unique = true, nullable = false, precision = 8, scale = 0)
	public Integer getCid() {
		return this.cid;
	}

	public void setCid(Integer cid) {
		this.cid = cid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "TID")
	public AccpTeacher getAccpTeacher() {
		return this.accpTeacher;
	}

	public void setAccpTeacher(AccpTeacher accpTeacher) {
		this.accpTeacher = accpTeacher;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "BID")
	public AccpBiz getAccpBiz() {
		return this.accpBiz;
	}

	public void setAccpBiz(AccpBiz accpBiz) {
		this.accpBiz = accpBiz;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "GID")
	public AccpGrade getAccpGrade() {
		return this.accpGrade;
	}

	public void setAccpGrade(AccpGrade accpGrade) {
		this.accpGrade = accpGrade;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "TYPE")
	public AccpClasstype getAccpClasstype() {
		return this.accpClasstype;
	}

	public void setAccpClasstype(AccpClasstype accpClasstype) {
		this.accpClasstype = accpClasstype;
	}

	@Column(name = "CLASSNAME", unique = true)
	public String getClassname() {
		return this.classname;
	}

	public void setClassname(String classname) {
		this.classname = classname;
	}

	@Column(name = "CNUM", precision = 8, scale = 0)
	public Integer getCnum() {
		return this.cnum;
	}

	public void setCnum(Integer cnum) {
		this.cnum = cnum;
	}

	@Column(name = "STATUS", precision = 8, scale = 0)
	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@Column(name = "CREATEDATE", length = 7)
	public Timestamp getCreatedate() {
		return this.createdate;
	}

	public void setCreatedate(Timestamp createdate) {
		this.createdate = createdate;
	}

	@Column(name = "CLASS_FILE")
	public String getClassFile() {
		return this.classFile;
	}

	public void setClassFile(String classFile) {
		this.classFile = classFile;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "accpClass")
	public Set<AccpTask> getAccpTasks() {
		return this.accpTasks;
	}

	public void setAccpTasks(Set<AccpTask> accpTasks) {
		this.accpTasks = accpTasks;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "accpClass")
	public Set<AccpHomework> getAccpHomeworks() {
		return this.accpHomeworks;
	}

	public void setAccpHomeworks(Set<AccpHomework> accpHomeworks) {
		this.accpHomeworks = accpHomeworks;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "accpClass")
	public Set<AccpStudent> getAccpStudents() {
		return this.accpStudents;
	}

	public void setAccpStudents(Set<AccpStudent> accpStudents) {
		this.accpStudents = accpStudents;
	}

}